

(function($) {
	// global variables
	$.kulstats = {};
})(jQuery);

function createProgress(progress) {
	progress.bar.addClass("progressbar")
	.append(
			$("<div/>")
			.addClass("progressbar_lprogress")
			.append(
					$("<div/>")
					.addClass("progressbar_rprogress")
					.append(
							$("<div/>")
							.addClass("progressbar_cprogress")
							.append(
									$("<div/>")
									.addClass("progressbar_progress")
							)
					)
			)
	);
	setProgress(progress);
}
function setProgress(progress) {
	var percent = (progress.cur/progress.tot)*100;
	if(progress.cur >= progress.tot) {
		percent = 100;
		progress.bar.find(".progressbar_progress").css("background","url(../images/fprogress2.gif) center left repeat-x")
	}
	progress.bar.find(".progressbar_progress").css("width",percent+"%")
}